import React, { Component } from "react";

class detail extends Component {
  render() {
    const list = [
      {
        img: require("../../images/teacher1.jpg").default,
        name: "谢依霖",
        class: "特级教师",
        school: "成都嘉祥七种外国语学校",
      },
      {
        img: require("../../images/teacher2.jpg").default,
        name: "李晓蕊",
        class: "一级教师",
        school: "北京二十四中",
      },
      {
        img: require("../../images/teacher3.jpg").default,
        name: "方展博",
        class: "一级教师",
        school: "中国人民大学附属中学",
      },
      {
        img: require("../../images/teacher4.jpg").default,
        name: "施洋",
        class: "一级教师",
        school: "雅礼中学",
      },
    ];
    const num = Number(this.props.id) - 1;
    // console.log(this.props);
    return (
      <div>
        <h2>{list[num].name}</h2>
        <img src={list[num].img} alt=" " style={{ display: "block" }} />
        <h3>{list[num].class}</h3>
        <h3>{list[num].school}</h3>
      </div>
    );
  }
}

export default detail;
